home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in</name>
- <id>-1</id>
- <cardCount>6</cardCount>
- <cardID>7752</cardID>
- <listID>5139</listID>
- <cantModify><false /></cantModify>
- <cantDelete><true /></cantDelete>
- <cantAbort><true /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>342</height>
- </cardSize>
- <script>on openStack
- global Connections, Terminals, ActiveWindow, CloseRequest
-
- if RegistrationDialog(1131) < 0 then
- go "Home"
- else
- put CTBInitialise() into CTBTools
- if CTBTools < 0 then
- go "Home"
- else
- set cursor to watch
- put line 1 of CTBTools into Connections
- put line 2 of CTBTools into Terminals
- modifyMenubar
- put empty into ActiveWindow
- put empty into CloseRequest
- visual effect dissolve fast
- go to card "Menu"
- end if
- end if
- end openStack
-
- on closeStack
- set cursor to watch
- checkStackSize
- reset menubar
- end closeStack
-
- on suspendStack
- set cursor to watch
- checkForLiveService
- closeBackground
- reset menubar
- end suspendStack
-
- on resumeStack
- set cursor to watch
- modifyMenubar
- openBackground
- end resumeStack
-
- on idle
- global CloseRequest
- if CloseRequest <> empty then
- CloseService CloseRequest
- put empty into CloseRequest
- end if
- pass Idle
- end Idle
-
- on doMenu ItemID, MenuID
- if ItemID = "Print Service Details" then
- print card
- exit doMenu
- end if
-
- if ItemID = "Print Script" then
- print background field "Script"
- exit doMenu
- end if
-
- if ItemId = "Rebuild Service List" then
- set lockmessages to true
- lock screen
- sort cards of background "Service" by bkgnd field "Service"
- go to the first card of background "Service"
- put id of last card of background "Service" into LastCard
- put 0 into LineCount
- put empty into fld "Services" in card "Menu"
- repeat
- set cursor to busy
- put the short name of this card into Temp
- put Temp into bkgnd field "Service"
- add 1 to LineCount
- put Temp into line Linecount of fld "Services" in card "Menu"
- if id of this card = LastCard then exit repeat
- go to next card of background "Service"
- end repeat
- go to card "Menu"
- unlock screen
- set lockmessages to false
- end if
-
- pass doMenu
- end doMenu
-
- on checkForLiveService
- Global ActiveWindow
- if ActiveWindow <> empty then
- closeService ActiveWindow
- end if
- end checkForLiveService
-
- on startService
- if the heapspace < 200000 then
- beep
- answer "Memory is running low and there may be insufficient remaining to Test this service." & return & return & ¬
- "(If the service fails to launch then more memory may be made available by reconfiguring HyperCard with more initial memory)." & return & " " ¬
- with "Abort Launch" or "Continue"
- if it = "Abort Launch" then exit to HyperCard
- end if
- set the highlite of background button "Help" to false
- hide bkgnd field "Help"
- put bkgnd field "Password" into Password
- if Password <> empty then
- ask password clear "This service is password protected." & return & "Enter the correct password :"
- if the Result = "Cancel" then
- exit startService
- end if
- if it <> Password then
- beep
- answer "Invalid password !!" with "Continue"
- exit startService
- end if
- end if
- put TestWindow(0, bkgnd field "Service", 1) into Ptr
- if Ptr > 0 then
- if bkgnd field "Connection" <> empty then hide menubar
- if OpenService(Ptr, true) = 0 then
- disable menu "Function"
- else
- send "Delete" to window bkgnd field "Service"
- end if
- show menubar
- end if
- end startService
-
- on closeService Service
- if CloseWindow("CloseNamed", Service, true) <> -1 then
- send "Delete" to window Service
- end if
- enable menu "Function"
- end closeService
-
- on modifyMenubar
- hide message
- set blindTyping to false
- choose browse tool
- set userlevel to 2
- delete menuitem "Print Field..." of menu "File"
- delete menuitem "Print card" of menu "File"
- delete menuitem "Print Stack..." of menu "File"
- delete menuitem "Print Report..." of menu "File"
- put "Print Service Details,Print Script,-,Rebuild Service List" after menuitem "Page Setup..." in menu "File"
- disable menuitem "Print Service Details" of menu "File"
- disable menuitem "Print Script" of menu "File"
- disable menuitem "Rebuild Service List" of menu "File"
- put "Undo,-,Cut,Copy,Paste,Clear" into menu "Edit"
- disable menuitem "Undo" in menu "Edit"
- set the commandChar of menuitem "Cut" of menu "Edit" to "X"
- set the commandChar of menuitem "Paste" of menu "Edit" to "V"
- set the commandChar of menuitem "Copy" of menu "Edit" to "C"
- disable menu "Edit"
- end modifyMenubar
-
- on updateServiceNames OldServiceName, NewServiceName
- Global ServiceMenu
-
- set cursor to busy
- put fld "Services" in card "Menu" into Temp
- put the number of lines in Temp into LineNo
- if OldServiceName <> empty then
- repeat with i = 1 to LineNo
- if line i of Temp = OldServicename then
- if NewServicename = empty then
- delete line i of Temp
- else
- put NewServiceName into line i of Temp
- end if
- sort lines of Temp ascending
- put Temp into fld "Services" in card "Menu"
- exit updateServiceNames
- end if
- end repeat
- end if
- add 1 to LineNo
- put NewServiceName into line LineNo of Temp
- sort lines of Temp ascending
- put Temp into fld "Services" in card "Menu"
- end updateServiceNames
-
- on checkStackSize
- put 10 into Percent
- get the size of stack
- put (it/100)*Percent into Margin
- get the freesize of stack
- put it into SlackBytes
- if SlackBytes > Margin then doMenu "Compact Stack"
- end checkStackSize
-
- on displayHelp Text
- if visible of bkgnd field "Help" is true then put Text into bkgnd field "Help"
- end displayHelp
- </script>
- <background id="2570" file="background_2570.xml" name="New Service" />
- <background id="3593" file="background_3593.xml" name="Menu" />
- <background id="4379" file="background_4379.xml" name="Script" />
- <background id="6067" file="background_6067.xml" name="Banner" />
- <background id="10650" file="background_10650.xml" name="Service" />
- <card id="7752" file="card_7752.xml" marked="false" name="Banner" owner="6067" />
- <card id="11475" file="card_11475.xml" marked="false" name="Menu" owner="3593" />
- <card id="4252" file="card_4252.xml" marked="false" name="Script" owner="4379" />
- <card id="8075" file="card_8075.xml" marked="false" name="New Service" owner="2570" />
- <card id="5787" file="card_5787.xml" marked="false" name="Example Service #1" owner="10650" />
- <card id="8573" file="card_8573.xml" marked="false" name="Example Service #2" owner="10650" />
- </stack>
-